﻿Imports BUS, DTO
Public Class frmThongKeTraTre

    Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox1.Enter

    End Sub


    Private Sub LoadDS()
        CrystalReport_ThongKeSachTraTre1.SetParameterValue("@Nam", NumericUpDown_Nam.Value)
        CrystalReport_ThongKeSachTraTre1.SetParameterValue("@Thang", NumericUpDown_Thang.Value)
        CrystalReportViewer_ThongKeTraTre.ReportSource = CrystalReport_ThongKeSachTraTre1

    End Sub


    Private Sub frmThongKeTraTre_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim tsBus As New ThamSoBUS()
        Dim tsDto As New ThamSoDTO()
        tsDto = tsBus.LayThongtin()

        NumericUpDown_Nam.Value = DateTime.Now.Year
        NumericUpDown_Thang.Value = DateTime.Now.Month
        CrystalReport_ThongKeSachTraTre1.SetParameterValue("@SoNgayTraSach", tsDto.SoNgayMuonSachToiDa)
    End Sub

    Private Sub NumericUpDown_Thang_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NumericUpDown_Thang.ValueChanged
        LoadDS()
    End Sub

    Private Sub NumericUpDown_Nam_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NumericUpDown_Nam.ValueChanged
        LoadDS()
    End Sub
End Class